"""
ComfyUI DCT-Net Plugin
A plugin that integrates DCT-Net (Domain-Calibrated Translation) into ComfyUI for portrait stylization.
"""

import os
import logging
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
from .test_dependencies import main as test_dependencies

# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("DCTNet")

# Test dependencies on import
try:
    if test_dependencies() != 0:
        logger.warning("Some DCT-Net dependencies are missing or outdated. The plugin may not work correctly.")
except Exception as e:
    logger.error(f"Failed to check dependencies: {str(e)}")

# Create cache directory
try:
    cache_dir = os.path.join(os.path.dirname(__file__), "models", "dctnet")
    os.makedirs(cache_dir, exist_ok=True)
except Exception as e:
    logger.error(f"Failed to create cache directory: {str(e)}")

# Register nodes
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"] 